<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/register.css">
    <link rel="stylesheet" href="css/reset.css">
    <script src="js/jquery-3.0.0.js"></script>
    <script src="js/jquery.cookie.js"></script>
</head>
<body>
    <div id="logo-warp">
    <div class="logo w980">
        <h1>
            <a href="">bangou</a>
        </h1>
    </div>
</div>
    <div class="login-main w980 clear">
        <div class="login-main-left fl">
            <a href="#">
                <img src="img/login_banner.jpg" alt="">
            </a>
        </div>
        <div class="login-main-right fl clear">
            <div class="login-main-top">
                <h3 class="t1 cstyle">帐户登录</h3>
                <h3 class="t2">手机登录</h3>
                <h3 class="t3">卡登录</h3>
            </div>
            <div class="login-main-bttom">
                <div class="login-form">
                    <form action="">
                        <div class="login-item mt30">
                            <div class="fl login-title" id="login-user">
                                用户名：
                            </div>
                            <div class="fl ovh">
                                <input type="text" id="loginName" class="fl input3" name="loginName"/>
                            </div>
                            <!--错误提示-->
                            <div class="login-tips fl">
                                <span class="garytips"></span>
                                <span class="redtips"></span>
                            </div>
                        </div>
                        <div class="login-item ">
                            <div class="fl login-title" id="login-pwdtitle" >
                                密码：
                            </div>
                            <div class="fl ovh">
                                <input type="password" id="loginpwd" class="fl input3" name="loginName"/>
                            </div>
                            <!--错误提示-->
                            <div class="login-tips fl">
                                <span class="garytips"></span>
                                <span class="redtips"></span>
                            </div>
                        </div>
                        <div class="login-item ">
                            <div class="fl login-title" id="login-verify" >
                                验证码：
                            </div>
                            <div class="fl ovh">
                                <input type="text" id="loginverify" class="fl input3 w62" name="loginName"/>
                            </div>
                            <!--图片验证-->
                            <div class="img-verify">
                                <a href="#">
                                    <img src="img/loginCode1.jpg" alt="">
                                    <a href="" class="changeimg">换一张</a>
                                </a>
                            </div>
                            <!--错误提示-->
                            <div class="login-tips ml80 fl">
                                <span class="garytips"></span>
                                <span class="redtips"></span>
                            </div>
                        </div>
                        <div class="login-item mt5">
                            <div class="ltext fl">&nbsp;</div>
                            <div class="fl">
                                <input type="checkbox" id="reusername" class="checek1"/>
                                <lable form="reusername" class="lmr20 font13">记住用户名</lable>
                                <input type="checkbox" id="autologin" class="checek1"/>
                                <lable form="autologin" class="lmr20 font13">自动登录</lable>
                            </div>
                        </div>
                        <div class="login-item lmt10">
                            <div class="ltext fl">&nbsp;</div>
                            <div class="login-button fl">
                                <a href="javascript:;">
                                    <img src="" alt="">
                                </a>
                            </div>
                            <a href="#" class="refer">找回密码？</a>
                        </div>
                    </form>
                </div>
                <div class="login-main-hr">
                    <span class="lmr5">还不是邦购网用户？马上加入吧~~~</span>
                    <a href="#" class="btn btn-common"><span>免费注册>></span></a>
                </div>
                <div class="login-surport">
                    <h4>或者使用合作网站登录：</h4>
                    <p>
                        <a href="http://bgact.banggo.com/Unionlogin/Authorize?from=qq" class="icon_qq" title="QQ">QQ</a>
                        <a href="http://bgact.banggo.com/Unionlogin/Authorize?from=alipay" class="icon_alipay" title="支付宝">支付宝</a>
                        <a href="http://act.banggo.com/UnionLogin?platform=sina" class="icon_weibo" title="新浪微博">新浪微博</a>
                        <a href="http://m.banggo.com/Api/wxLogin" class="icon_weixin" title="微信">微信</a>
                        <a href="http://act.banggo.com/UnionLogin?platform=renren" class="icon_renren" title="人人网">人人网</a>
                        <a style="cursor:default;"></a>
                    </p>
                </div>
            </div>

        </div>

    </div>
    <div class="login-bot">
        美特斯邦威集团网站：
        <a href="http://www.metersbonwe.com/">美特斯邦威</a> |
        <a href="http://www.me-city.com/">ME&amp;CITY</a> |
        <a href="http://www.chincn.com/">CH'IN祺</a> |
        <a href="http://www.banggo.com">邦购网</a>
    </div>
</body>
</html>
<script>

$(function(){

$(".t2").click(function(){

		$(this).addClass("cstyle");$(".t1").removeClass("cstyle");
		$("#login-user").text("手机号:");
})
$(".t1").click(function(){

		$(this).addClass("cstyle");$(".t2").removeClass("cstyle");
		$("#login-user").text("用户名:");
})
if($(".t1").hasClass("cstyle")){
	$(".login-button").click(function(){
		$.cookie("user",$("#loginName").val())
	if($("#reusername").prop("checked")==true){
		$.cookie("user",$("#loginName").val(),{expires:7});
	
	
	}
			 $.ajax({
                url:"http://localhost/reg/login.php",
                type:"post",
                data:{
                    "loginName":$("#loginName").val(),
                    "loginPwd":$("#loginpwd").val()
                },
                success:function (res) {
                    var obj=JSON.parse(res);
                      console.log(res);
                    if(obj.status==1){
                        alert(obj.msg);
                        window.location.href="index.html";
                   }						
                }
            })

		})};
		if($(".t2").hasClass("cstyle")){
	$(".login-button").click(function(){
	console.log($("loginpwd").val())
			 $.ajax({
                url:"http://localhost/reg/login2.php",
                type:"post",
                data:{
                    "phone":$("#loginName").val(),
                    "loginPwd":$("#loginpwd").val()
                },
                success:function (res) {
                    var obj=JSON.parse(res);
                      console.log(res);
                    if(obj.status==1){
                        alert(obj.msg);
                        window.location.href="index.html";
                   }						
                }
            })

		})}







})
</script>